package com.lanyam.travel.base.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 
 * </p>
 *
 * @author rosson
 * @since 2020-01-24
 */
@TableName("USER")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;
    @JsonProperty(value="id")
    private String id;
    
    @JsonProperty(value="nickName")
    @TableField("nick_name")
    private String nickName;
    
    @JsonProperty(value="name")
    @TableField("NAME")
    private String name;
    
    @JsonProperty(value="phone")
    private String phone;
    
    @JsonProperty(value="password")
    @TableField("PASSWORD")
    private String password;
    
    @JsonProperty(value="sex")
    @TableField("sex")
    private Integer sex;
    
    @JsonProperty(value="email")
    private String email;
    
    @JsonProperty(value="faceImg")
    @TableField("face_img")
    private String faceImg;
    
    @JsonProperty(value="bankCard")
    @TableField("bank_card")
    private String bankCard;
    
    @JsonProperty(value="idCard")
    @TableField("id_card")
    private String idCard;
    
    @JsonProperty(value="passportCard")
    @TableField("passport_card")
    private String passportCard;
    
    @JsonProperty(value="idCardFrontImg")
    @TableField("id_card_front_img")
    private String idCardFrontImg;
    
    @JsonProperty(value="idCardBackImg")
    @TableField("id_card_back_img")
    private String idCardBackImg;
    
    @JsonProperty(value="passportCardFrontImg")
    @TableField("passport_card_front_img")
    private String passportCardFrontImg;
    
    @JsonProperty(value="passportCardBackImg")
    @TableField("passport_card_back_img")
    private String passportCardBackImg;
    
    @JsonProperty(value="teamId")
    @TableField("team_id")
    private String teamId;
    
    @JsonProperty(value="openid")
    @TableField("openid")
    private String openid;
    
    @JsonProperty(value="status")
    @TableField("STATUS")
    private int status;
    
    @JsonProperty(value="createDate")
    @TableField("create_date")
    private Date createDate;
    
    @JsonProperty(value="updateDate")
    @TableField("update_date")
    private Date updateDate;
    
    @JsonProperty(value="roleId")
    @ApiModelProperty(value = "角色外键id")
    @TableField("role_id")
    private String roleId;
    
    @JsonProperty(value="supplyId")
    @ApiModelProperty(value = "供应商id")
    @TableField("supply_id")
    private String supplyId;
    /**
     * 返回给前台的token
     */
    @JsonProperty(value="token")
    @TableField(exist = false)
    private String token;

    @JsonProperty(value="role")
    @TableField(exist = false)
    private Role role;
    
    @JsonProperty(value="permissions")
    @TableField(exist = false)
    private List<Permission> permissions;
    
    @JsonProperty(value="permissionIds")
    @TableField(exist = false)
    private List<String> permissionIds;

    /**
     * 记录普通会员的身份，0为普通会员，1为业务员（分销成员表里面的分销层级是0），如果有其他身份，再加值
     */
    @JsonProperty(value="userRole")
    @TableField(exist = false)
    private int userRole;
    
    /**
     * 普通会员的消费金额
     */
    @JsonProperty(value="totalCost")
    @TableField(exist = false)
    private double totalCost;
    
    
    
    public double getTotalCost() {
		return totalCost;
	}

	public void setTotalCost(double totalCost) {
		this.totalCost = totalCost;
	}

	public int getUserRole() {
		return userRole;
	}

	public void setUserRole(int userRole) {
		this.userRole = userRole;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public List<String> getPermissionIds() {
		return permissionIds;
	}

	public void setPermissionIds(List<String> permissionIds) {
		this.permissionIds = permissionIds;
	}

	public String getPassportCard() {
		return passportCard;
	}

	public void setPassportCard(String passportCard) {
		this.passportCard = passportCard;
	}

	public String getPassportCardFrontImg() {
		return passportCardFrontImg;
	}

	public void setPassportCardFrontImg(String passportCardFrontImg) {
		this.passportCardFrontImg = passportCardFrontImg;
	}

	public String getPassportCardBackImg() {
		return passportCardBackImg;
	}

	public void setPassportCardBackImg(String passportCardBackImg) {
		this.passportCardBackImg = passportCardBackImg;
	}

    public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getSupplyId() {
		return supplyId;
	}

	public void setSupplyId(String supplyId) {
		this.supplyId = supplyId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}


	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public List<Permission> getPermissions() {
		return permissions;
	}

	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getId() {
        return id;
    }

    public User setId(String id) {
        this.id = id;
        return this;
    }

    public String getNickName() {
        return nickName;
    }

    public User setNickName(String nickName) {
        this.nickName = nickName;
        return this;
    }

    public String getName() {
        return name;
    }

    public User setName(String name) {
        this.name = name;
        return this;
    }

    public String getPhone() {
        return phone;
    }

    public User setPhone(String phone) {
        this.phone = phone;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public User setPassword(String password) {
        this.password = password;
        return this;
    }

    public String getEmail() {
        return email;
    }

    public User setEmail(String email) {
        this.email = email;
        return this;
    }

    public String getFaceImg() {
        return faceImg;
    }

    public User setFaceImg(String faceImg) {
        this.faceImg = faceImg;
        return this;
    }

    public String getBankCard() {
        return bankCard;
    }

    public User setBankCard(String bankCard) {
        this.bankCard = bankCard;
        return this;
    }

    public String getIdCard() {
        return idCard;
    }

    public User setIdCard(String idCard) {
        this.idCard = idCard;
        return this;
    }

    public String getIdCardFrontImg() {
        return idCardFrontImg;
    }

    public User setIdCardFrontImg(String idCardFrontImg) {
        this.idCardFrontImg = idCardFrontImg;
        return this;
    }

    public String getIdCardBackImg() {
        return idCardBackImg;
    }

    public User setIdCardBackImg(String idCardBackImg) {
        this.idCardBackImg = idCardBackImg;
        return this;
    }

    public String getTeamId() {
        return teamId;
    }

    public User setTeamId(String teamId) {
        this.teamId = teamId;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "User{" +
        ", id=" + id +
        ", nickName=" + nickName +
        ", name=" + name +
        ", phone=" + phone +
        ", password=" + password +
        ", email=" + email +
        ", faceImg=" + faceImg +
        ", bankCard=" + bankCard +
        ", idCard=" + idCard +
        ", idCardFrontImg=" + idCardFrontImg +
        ", idCardBackImg=" + idCardBackImg +
        ", teamId=" + teamId +
        "}";
    }
}
